var _util = require("util/util.js");

var order = {
	//创建订单
	create : function(data,resolve,reject){
		_util.request({
            url     : _util.getServerUrl('/order/create.do'),
            method  : 'POST',
            data	: data,
            success : resolve,
            error   : reject
        });
	},
    //创建订单
    createBuyNow : function(data,resolve,reject){
        _util.request({
            url     : _util.getServerUrl('/order/create_buy_now.do'),
            method  : 'POST',
            data    : data,
            success : resolve,
            error   : reject
        });
    },
    //查询订单状态
    queryOrderPayStatus : function(data,resolve,reject){
        _util.request({
            url     : _util.getServerUrl('/order/query_order_pay_status.do'),
            method  : 'POST',
            data    : data,
            success : resolve,
            error   : reject
        });
    },
    //详情
    queryDetail : function(data,resolve,reject){
        _util.request({
            url     : _util.getServerUrl('/order/detail.do'),
            method  : 'POST',
            data    : data,
            success : resolve,
            error   : reject
        });
    },
    //详情
    cancel : function(data,resolve,reject){
        _util.request({
            url     : _util.getServerUrl('/order/cancel.do'),
            method  : 'POST',
            data    : data,
            success : resolve,
            error   : reject
        });
    },
    //列表
    list :  function(data,resolve,reject){
        _util.request({
            url     : _util.getServerUrl('/order/list.do'),
            method  : 'POST',
            data    : data,
            success : resolve,
            error   : reject
        });
    },
}

module.exports = order;